package com.java_base.loop;

import java.util.Random;

public class RandomDemo02 {
    public static void main(String[] args) {
        Random rd = new Random();
        int nextInt = 0;
        // 输出10内的随机数
        for (int i = 0; i < 10; i++) {
            nextInt = rd.nextInt(10);
            System.out.print(nextInt+"\t");
        }
        System.out.println();
        // 输出1~10之间的随机数
        for (int j = 0; j < 9; j++) {
            System.out.println(rd.nextInt(10)+1);

        }
    }
}
